<template>
  <BasicDrawer v-bind="$attrs" @register="registerDrawer" title="推送详情信息" width="700px">
    <Description @register="registerDescription" :data="detailData" />
  </BasicDrawer>

</template>
<script lang="ts" setup>
import {onMounted, onUnmounted, ref} from 'vue';
import {BasicDrawer, useDrawerInner} from '/@/components/Drawer';
import {pushDetailSchema} from './history.data';
import {Description, useDescription} from '/@/components/Description/index';

const detailData = ref({});
// 声明Emits
const emit = defineEmits(['success', 'register'])
//表单配置
const [registerDescription] = useDescription({
  column: 1,
  // data: mockData,
  schema: pushDetailSchema,
  labelStyle: {
    marginLeft: '10px',
    width: '100px'
  }
});

onUnmounted(() => {
  console.log('========> onUnmounted');
})

onMounted(() => {
  console.log('========> onMounted');
})

const [registerDrawer, { setDrawerProps, closeDrawer }] = useDrawerInner(async (data) => {
  setDrawerProps({ confirmLoading: false });
  console.log("record: ", data.record);
  detailData.value = data.record
});

</script>
